#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>
#include <QAction>
#include <QToolBar>
#include <QLabel>
#include <QApplication>
#include <QVBoxLayout>
#include <QStackedWidget>
#include <QLinearGradient>
#include <QPainter>
#include <QPushButton>
#include "conectionwindow.h"
#include "userregistration.h"
#include "clientsearch.h"

class ToolBar : public QToolBar
{
public:
    ToolBar(QWidget * = 0);
protected:
    void paintEvent(QPaintEvent *);
};

class MainWindow : public QMainWindow
{
    Q_OBJECT

    ConnectionWindow *connection_window;
    UserRegistration *user_registration;
    UserSearch *user_search; // вікно пошуку клієнтів
    QAction *user_registration_act, *user_search_act, *db_backup_act, *connection_act;
    QStackedWidget *central_wid;
    void __commonHandle(QWidget*, QAction*, uint, uint, uint, uint, bool = true);
protected:
    void paintEvent(QPaintEvent *);
    void resizeEvent(QResizeEvent *);
public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();
private slots:
    void connectionSettings();
    void enableLeftToolBarActions();
    void disableLeftToolBarActions();
    void userRegistration();
    void userSearching();
};

#endif // MAINWINDOW_H
